package com.wc.fortnight_blue_bridge.Q231125.Q8733;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;

/**
 * @Author congege
 * @Description
 * @Date Created in 2023/11/26-16:59
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();
        int n = sc.nextInt();
        ArrayList<Integer> array = new ArrayList<>();
        int[] originArray = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            int num = sc.nextInt();
            array.add(num);
            originArray[i] = num;
        }
        Collections.sort(array);
        int m = sc.nextInt();
        double[] ansArray = new double[m];
        for (int i = 0; i < m; i++) {
            int idx = sc.nextInt();
            int num = originArray[idx];
            int removeIdx = search(num, array);
            array.remove(removeIdx);
            n--;
            if (n % 2 == 0) {
                ansArray[i] = (array.get(n / 2) + array.get(n / 2 - 1)) * 1.0 / 2;
            } else {
                ansArray[i] = array.get(n / 2);
            }
        }
        PrintStream out = System.out;
        for (int i = 0; i < m; i++) {
            if (i == 0) {
                out.printf("%.1f", ansArray[i]);
                continue;
            }
            out.printf(" %.1f ", ansArray[i]);
        }

    }

    static public int search(int val, ArrayList<Integer> array) {
        int left = 0;
        int right = array.size() - 1;
        int mid;
        int num;
        while (left <= right) {
            mid = left + (right - left) / 2;
            num = array.get(mid);
            if (num == val) {
                return mid;
            } else if (num > val) {
                right = mid - 1;
            } else {
                left = mid + 1;
            }
        }

        return -1;
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }
    }
}
